package basic_image_editor;

import FileChooser.ImageFileView;
import FileChooser.ImageFilter;
import FileChooser.ImagePreview;
import ViewClass.ScrollImage;
import basic_image_editor.Noisefilter.NoiseFilterHandler;
import basic_image_editor.PointOperations.Basic.Histogram.BarChart;
import basic_image_editor.PointOperations.ChangeHistogram.ChangeBrightness;
import basic_image_editor.PointOperations.ChangeHistogram.ChangeContrast;
import basic_image_editor.PointOperations.ChangeHistogram.ChangeOpacity;
import basic_image_editor.PointOperations.ChangeHistogram.CropImage;
import basic_image_editor.PointOperations.PointOperationHandler;
import basic_image_editor.Resampling.ResamplingHandler;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.*;

/**
 ************************************************************************************
 * @Author : Gihan Chanuka Karunarathne
 * @Address : 123, R.B.Rathnamalala Road, Eppawala, Anuradhapura, Sri Lanka. 50260
 * @Bsc : Department of Computer Science and Engineering
 *        University of Moratuwa, Sri Lanka
 * Date created : 
 * @Email : gckarunarathne@gmail.com
 * Twitter: https://twitter.com/#!/gihanchanuka
 * LinkedIn: http://lk.linkedin.com/pub/gihan-karunarathne/25/ba3/993
 *************************************************************************************
 */

public class MainWindow extends javax.swing.JFrame {

    /*
     * variables difine
     */
    private BufferedImage buffImage;
    private ImageIcon currentImage;
    private JFileChooser fc;
    private String picPath = "samples/water.jpg";

    /**
     * Creates new form MainWindow
     */
    public MainWindow() {
        initComponents();
        setLocationRelativeTo(null);
        setTitle("Basic Image Editor");
        tabPanel.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT);
    }

    /*
     * window controller methods
     */
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelUpper = new javax.swing.JPanel();
        buttonMean3x3 = new javax.swing.JButton();
        buttonMean5x5 = new javax.swing.JButton();
        buttonMedian3x3 = new javax.swing.JButton();
        buttonMedian5x5 = new javax.swing.JButton();
        buttonLinear3x3 = new javax.swing.JButton();
        buttonLinearMxN = new javax.swing.JButton();
        textFieldBrowse = new javax.swing.JTextField();
        buttonBrowse = new javax.swing.JButton();
        panelLeft = new javax.swing.JPanel();
        buttonNearestScaleUp = new javax.swing.JButton();
        buttonNearestScaleDown = new javax.swing.JButton();
        buttonBiLinearScaleUp = new javax.swing.JButton();
        buttonBiLinearScaleDown = new javax.swing.JButton();
        buttonLinearHorizontalUp = new javax.swing.JButton();
        buttonLinearVerticalUp = new javax.swing.JButton();
        buttonLinearHorizontalDown = new javax.swing.JButton();
        buttonLinearVerticalDown = new javax.swing.JButton();
        buttonSave = new javax.swing.JButton();
        comboBoxFormat = new javax.swing.JComboBox();
        buttonChangeBrightness = new javax.swing.JButton();
        buttonChangeOpacity = new javax.swing.JButton();
        buttonCropImage = new javax.swing.JButton();
        buttonChangeContrast = new javax.swing.JButton();
        panelBottom = new javax.swing.JPanel();
        buttonTranspose = new javax.swing.JButton();
        bottonVerticalFlip = new javax.swing.JButton();
        buttonDigitalNegative = new javax.swing.JButton();
        buttonHistogram = new javax.swing.JButton();
        buttonBitSlicingWithoutBackGround = new javax.swing.JButton();
        buttonBitSlicingWithBackGround = new javax.swing.JButton();
        buttonNormalView = new javax.swing.JButton();
        tabPanel = new javax.swing.JTabbedPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        menuItemOpenImage = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        menuItemSaveImage = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        menuItemCrop = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(213, 253, 10));

        panelUpper.setBackground(new java.awt.Color(195, 248, 7));

        buttonMean3x3.setText("Mean3x3");
        buttonMean3x3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonMean3x3ActionPerformed(evt);
            }
        });

        buttonMean5x5.setText("Mean5x5");
        buttonMean5x5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonMean5x5ActionPerformed(evt);
            }
        });

        buttonMedian3x3.setText("Median3x3");
        buttonMedian3x3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonMedian3x3ActionPerformed(evt);
            }
        });

        buttonMedian5x5.setText("Median5x5");
        buttonMedian5x5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonMedian5x5ActionPerformed(evt);
            }
        });

        buttonLinear3x3.setText("Linear3x3");
        buttonLinear3x3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLinear3x3ActionPerformed(evt);
            }
        });

        buttonLinearMxN.setText("LinearMxN");
        buttonLinearMxN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLinearMxNActionPerformed(evt);
            }
        });

        buttonBrowse.setText("Browse");
        buttonBrowse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBrowseActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelUpperLayout = new javax.swing.GroupLayout(panelUpper);
        panelUpper.setLayout(panelUpperLayout);
        panelUpperLayout.setHorizontalGroup(
            panelUpperLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelUpperLayout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addComponent(buttonMean3x3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonMean5x5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonMedian3x3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonMedian5x5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLinear3x3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLinearMxN)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
                .addComponent(textFieldBrowse, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonBrowse, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        panelUpperLayout.setVerticalGroup(
            panelUpperLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelUpperLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(panelUpperLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelUpperLayout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addGroup(panelUpperLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textFieldBrowse, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(buttonBrowse)))
                    .addGroup(panelUpperLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(panelUpperLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(buttonMean3x3)
                            .addComponent(buttonMean5x5)
                            .addComponent(buttonMedian3x3)
                            .addComponent(buttonMedian5x5)
                            .addComponent(buttonLinear3x3))
                        .addComponent(buttonLinearMxN)))
                .addContainerGap())
        );

        panelLeft.setBackground(new java.awt.Color(235, 161, 14));

        buttonNearestScaleUp.setText("NearestScaleUp");
        buttonNearestScaleUp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonNearestScaleUpActionPerformed(evt);
            }
        });

        buttonNearestScaleDown.setText("NearestScaleDown");
        buttonNearestScaleDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonNearestScaleDownActionPerformed(evt);
            }
        });

        buttonBiLinearScaleUp.setText("BiLinearScaleUp");
        buttonBiLinearScaleUp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBiLinearScaleUpActionPerformed(evt);
            }
        });

        buttonBiLinearScaleDown.setText("BiLinearScaleDown");
        buttonBiLinearScaleDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBiLinearScaleDownActionPerformed(evt);
            }
        });

        buttonLinearHorizontalUp.setText("LinearHorizontalUp");
        buttonLinearHorizontalUp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLinearHorizontalUpActionPerformed(evt);
            }
        });

        buttonLinearVerticalUp.setText("LinearVerticalUp");
        buttonLinearVerticalUp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLinearVerticalUpActionPerformed(evt);
            }
        });

        buttonLinearHorizontalDown.setText("LinearHorizontalDown");
        buttonLinearHorizontalDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLinearHorizontalDownActionPerformed(evt);
            }
        });

        buttonLinearVerticalDown.setText("LinearVerticalDown");
        buttonLinearVerticalDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonLinearVerticalDownActionPerformed(evt);
            }
        });

        buttonSave.setText("Save");
        buttonSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSaveActionPerformed(evt);
            }
        });

        comboBoxFormat.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "png", "jpg" }));

        buttonChangeBrightness.setText("Change Brightness");
        buttonChangeBrightness.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonChangeBrightnessActionPerformed(evt);
            }
        });

        buttonChangeOpacity.setText("Change Opacity");
        buttonChangeOpacity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonChangeOpacityActionPerformed(evt);
            }
        });

        buttonCropImage.setText("Crop Image");
        buttonCropImage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCropImageActionPerformed(evt);
            }
        });

        buttonChangeContrast.setText("Change Contrast");
        buttonChangeContrast.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonChangeContrastActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelLeftLayout = new javax.swing.GroupLayout(panelLeft);
        panelLeft.setLayout(panelLeftLayout);
        panelLeftLayout.setHorizontalGroup(
            panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLeftLayout.createSequentialGroup()
                .addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelLeftLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(buttonNearestScaleUp)
                            .addComponent(buttonNearestScaleDown)
                            .addComponent(buttonBiLinearScaleUp)
                            .addComponent(buttonBiLinearScaleDown)
                            .addComponent(buttonLinearHorizontalUp)
                            .addComponent(buttonLinearVerticalUp)
                            .addComponent(buttonLinearHorizontalDown)
                            .addComponent(buttonLinearVerticalDown)))
                    .addGroup(panelLeftLayout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(buttonSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(comboBoxFormat, 0, 102, Short.MAX_VALUE)))
                    .addGroup(panelLeftLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(buttonChangeBrightness))
                    .addGroup(panelLeftLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(buttonChangeOpacity))
                    .addGroup(panelLeftLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(buttonCropImage))
                    .addGroup(panelLeftLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(buttonChangeContrast)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelLeftLayout.setVerticalGroup(
            panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLeftLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonNearestScaleUp)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonNearestScaleDown)
                .addGap(18, 18, 18)
                .addComponent(buttonBiLinearScaleUp)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonBiLinearScaleDown)
                .addGap(16, 16, 16)
                .addComponent(buttonLinearHorizontalUp)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLinearVerticalUp)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLinearHorizontalDown)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonLinearVerticalDown)
                .addGap(7, 7, 7)
                .addComponent(buttonChangeOpacity)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonChangeBrightness)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(buttonChangeContrast)
                .addGap(18, 18, 18)
                .addComponent(buttonCropImage)
                .addGap(27, 27, 27)
                .addComponent(buttonSave, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addComponent(comboBoxFormat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        panelBottom.setBackground(new java.awt.Color(231, 35, 186));

        buttonTranspose.setText("Transpose");
        buttonTranspose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTransposeActionPerformed(evt);
            }
        });

        bottonVerticalFlip.setText("Vertical");
        bottonVerticalFlip.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bottonVerticalFlipActionPerformed(evt);
            }
        });

        buttonDigitalNegative.setText("Nagative");
        buttonDigitalNegative.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonDigitalNegativeActionPerformed(evt);
            }
        });

        buttonHistogram.setText("Histogram");
        buttonHistogram.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonHistogramActionPerformed(evt);
            }
        });

        buttonBitSlicingWithoutBackGround.setText("BitSlicing");
        buttonBitSlicingWithoutBackGround.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBitSlicingWithoutBackGroundActionPerformed(evt);
            }
        });

        buttonBitSlicingWithBackGround.setText("BitSlicingB");
        buttonBitSlicingWithBackGround.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonBitSlicingWithBackGroundActionPerformed(evt);
            }
        });

        buttonNormalView.setText("Normal View");
        buttonNormalView.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonNormalViewActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelBottomLayout = new javax.swing.GroupLayout(panelBottom);
        panelBottom.setLayout(panelBottomLayout);
        panelBottomLayout.setHorizontalGroup(
            panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelBottomLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonNormalView)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 103, Short.MAX_VALUE)
                .addComponent(buttonBitSlicingWithBackGround)
                .addGap(18, 18, 18)
                .addComponent(buttonBitSlicingWithoutBackGround)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonHistogram)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonDigitalNegative)
                .addGap(12, 12, 12)
                .addComponent(bottonVerticalFlip)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buttonTranspose)
                .addGap(22, 22, 22))
        );
        panelBottomLayout.setVerticalGroup(
            panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBottomLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonNormalView)
                    .addComponent(buttonBitSlicingWithBackGround)
                    .addComponent(buttonBitSlicingWithoutBackGround)
                    .addComponent(buttonHistogram)
                    .addComponent(buttonDigitalNegative)
                    .addComponent(bottonVerticalFlip)
                    .addComponent(buttonTranspose))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jMenu1.setText("File");

        menuItemOpenImage.setText("Open Image");
        menuItemOpenImage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItemOpenImageActionPerformed(evt);
            }
        });
        jMenu1.add(menuItemOpenImage);
        jMenu1.add(jSeparator2);

        menuItemSaveImage.setText("Save Picture");
        menuItemSaveImage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItemSaveImageActionPerformed(evt);
            }
        });
        jMenu1.add(menuItemSaveImage);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");

        menuItemCrop.setText("Crop");
        menuItemCrop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItemCropActionPerformed(evt);
            }
        });
        jMenu2.add(menuItemCrop);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Info");
        jMenu3.setToolTipText("Name : H.M.G.C.Karunarathne Index No: 090248X");

        jMenuItem1.setText("Details");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem1);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelUpper, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(tabPanel)
                    .addComponent(panelBottom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panelUpper, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(tabPanel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(panelBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(panelLeft, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonTransposeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTransposeActionPerformed
        this.currentImage = new PointOperationHandler().viewTranspose(picPath);
        Component newContentPane = new ScrollImage(currentImage);
        //newContentPane.setOpaque(true); //content panes must be opaque
//        panelMiddle.add(newContentPane);
        tabPanel.removeAll();
        tabPanel.add("Transpose", newContentPane);
        System.out.println("dimension: " + newContentPane.getWidth() + " " + newContentPane.getHeight());

    }//GEN-LAST:event_buttonTransposeActionPerformed

    private void bottonVerticalFlipActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bottonVerticalFlipActionPerformed
        this.currentImage = new PointOperationHandler().viewVerticalFlip(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Vertical Flip", newContentPane1);
    }//GEN-LAST:event_bottonVerticalFlipActionPerformed

    private void buttonDigitalNegativeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDigitalNegativeActionPerformed
        this.currentImage = new PointOperationHandler().viewDigitalNegative(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Digital Negative", newContentPane1);
    }//GEN-LAST:event_buttonDigitalNegativeActionPerformed

    private void buttonHistogramActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonHistogramActionPerformed
        this.currentImage = null;
        BarChart newContentPane1 = new PointOperationHandler().viewHistogram(picPath);
        JLabel l1 = new JLabel("Mean: " + newContentPane1.getMean());
        JLabel l2 = new JLabel("           Variance: " + newContentPane1.getStd());

        newContentPane1.add(l1);
        newContentPane1.add(l2);
        JPanel p = new JPanel();
        p.add(l1);
        p.add(l2);
        Component add = tabPanel.add("Gray Image Histogram", newContentPane1);
        tabPanel.add("Statistics of Image", p);

    }//GEN-LAST:event_buttonHistogramActionPerformed

    private void buttonBitSlicingWithoutBackGroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBitSlicingWithoutBackGroundActionPerformed
        this.currentImage = new PointOperationHandler().viewBitSlicingWithoutBackGround(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("BitSlicing Without Background", newContentPane1);
    }//GEN-LAST:event_buttonBitSlicingWithoutBackGroundActionPerformed

    private void buttonBitSlicingWithBackGroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBitSlicingWithBackGroundActionPerformed
        this.currentImage = new PointOperationHandler().viewBitSlicingWithBackGround(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("BitSlicing With Background", newContentPane1);
    }//GEN-LAST:event_buttonBitSlicingWithBackGroundActionPerformed

    private void buttonMean3x3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMean3x3ActionPerformed
        this.currentImage = new NoiseFilterHandler().viewMean3x3FilterImage(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Mean 3x3 Filtering", newContentPane1);
    }//GEN-LAST:event_buttonMean3x3ActionPerformed

    private void buttonMean5x5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMean5x5ActionPerformed
        this.currentImage = new NoiseFilterHandler().viewMean5x5FilterImage(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Mean 5x5 Filtering", newContentPane1);
    }//GEN-LAST:event_buttonMean5x5ActionPerformed

    private void buttonMedian3x3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMedian3x3ActionPerformed
        this.currentImage = new NoiseFilterHandler().viewMedian3x3FilterImage(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Median 3x3 Filtering", newContentPane1);
    }//GEN-LAST:event_buttonMedian3x3ActionPerformed

    private void buttonMedian5x5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMedian5x5ActionPerformed
        this.currentImage = new NoiseFilterHandler().viewMedian5x5FilterImage(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Median 5x5 Filtering", newContentPane1);
    }//GEN-LAST:event_buttonMedian5x5ActionPerformed

    private void buttonLinear3x3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLinear3x3ActionPerformed
        this.currentImage = new NoiseFilterHandler().viewLinearFilter3x3(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Linear 3x3 Filtering", newContentPane1);
    }//GEN-LAST:event_buttonLinear3x3ActionPerformed

    private void buttonLinearMxNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLinearMxNActionPerformed
        this.currentImage = new NoiseFilterHandler().viewLinearFilterMxN(picPath);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Linear MxN Filtering", newContentPane1);
    }//GEN-LAST:event_buttonLinearMxNActionPerformed

    private void buttonNearestScaleUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNearestScaleUpActionPerformed
        this.currentImage = new ResamplingHandler().viewNearestScaleUpImage(picPath, 3);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Nearest Scale Up Image x " + 3, newContentPane1);
    }//GEN-LAST:event_buttonNearestScaleUpActionPerformed

    private void buttonNearestScaleDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNearestScaleDownActionPerformed
        this.currentImage = new ResamplingHandler().viewNearestScaleDownImage(picPath, 2);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Nearest Scale Down Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonNearestScaleDownActionPerformed

    private void buttonBiLinearScaleUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBiLinearScaleUpActionPerformed
        this.currentImage = new ResamplingHandler().viewBi_LinearScaleUpImage(picPath, 2);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Bi-Linear Scale Up Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonBiLinearScaleUpActionPerformed

    private void buttonBiLinearScaleDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBiLinearScaleDownActionPerformed
        this.currentImage = new ResamplingHandler().viewBi_LinearScaleDownImage(picPath, 2);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Bi-Linear Scale Down Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonBiLinearScaleDownActionPerformed

    private void buttonLinearHorizontalUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLinearHorizontalUpActionPerformed
        this.currentImage = new ResamplingHandler().viewLinearScaleUpImageHorizontal(picPath, 2);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Linear Horizontal Scale Up Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonLinearHorizontalUpActionPerformed

    private void buttonLinearVerticalUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLinearVerticalUpActionPerformed
        this.currentImage = new ResamplingHandler().viewLinearScaleUpImageVertical(picPath, 2);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Linear Vertical Scale Up Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonLinearVerticalUpActionPerformed

    private void buttonLinearHorizontalDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLinearHorizontalDownActionPerformed
        this.currentImage = new ResamplingHandler().viewLinearScaleDownImageHorizontal(picPath, 1);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Linear Horizontal Scale Down Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonLinearHorizontalDownActionPerformed

    private void buttonLinearVerticalDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLinearVerticalDownActionPerformed
        this.currentImage = new ResamplingHandler().viewLinearScaleDownImageVertical(picPath, 1);
        Component newContentPane1 = new ScrollImage(currentImage);
        tabPanel.removeAll();
        tabPanel.add("Linear Vertical Scale Down Image x " + 2, newContentPane1);
    }//GEN-LAST:event_buttonLinearVerticalDownActionPerformed

    private void buttonBrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBrowseActionPerformed
        //Set up the file chooser.
        if (fc == null) {
            fc = new JFileChooser();

            //Add a custom file filter and disable the default
            //(Accept All) file filter.
            fc.addChoosableFileFilter(new ImageFilter());
            fc.setAcceptAllFileFilterUsed(false);

            //Add custom icons for file types.
            fc.setFileView(new ImageFileView());

            //Add the preview pane.
            fc.setAccessory(new ImagePreview(fc));
        }

        //Show it.
        int returnVal = fc.showDialog(this,
                "Attach");

        //Process the results.
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();

            this.picPath = file.getAbsolutePath();
            textFieldBrowse.setText(this.picPath);
        } else {

            //custom title, warning icon
            JOptionPane.showMessageDialog(this,
                    "You have to select a picture in order to apply operations.",
                    "Warning",
                    JOptionPane.WARNING_MESSAGE);
        }

        //Reset the file chooser for the next time it's shown.
        fc.setSelectedFile(null);

    }//GEN-LAST:event_buttonBrowseActionPerformed

    private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed
        /*
         * Save the filtered image in the selected format. The selected item
         * will be the name of the format to use
         */
        String format = (String) comboBoxFormat.getSelectedItem();
        /*
         * Use the format name to initialise the file suffix. Format names
         * typically correspond to suffixes
         */
        if (currentImage != null) {
            File saveFile = new File("savedimage." + format);
            JFileChooser chooser = new JFileChooser();
            chooser.setSelectedFile(saveFile);
            int rval = chooser.showSaveDialog(comboBoxFormat);
            if (rval == JFileChooser.APPROVE_OPTION) {
                saveFile = chooser.getSelectedFile();
                /*
                 * Write the filtered image in the selected format, to the file
                 * chosen by the user.
                 */
                chooser.setSelectedFile(null);
                try {
                    this.buffImage = getBufferedImage(currentImage);
                    ImageIO.write(buffImage, format, saveFile);
                } catch (IOException ex) {
                    chooser.setSelectedFile(null);
                }
            }else{
                JOptionPane.showMessageDialog(this,
                    "You have to create a picture in order to apply operations.",
                    "Warning",
                    JOptionPane.WARNING_MESSAGE);
            }
        }
    }//GEN-LAST:event_buttonSaveActionPerformed

    private void buttonChangeBrightnessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChangeBrightnessActionPerformed
        this.currentImage = null;
        ChangeBrightness newContentPane1 = new PointOperationHandler().viewChangeBrightness(picPath);
        tabPanel.removeAll();
        tabPanel.add("Change Brightness", newContentPane1);
    }//GEN-LAST:event_buttonChangeBrightnessActionPerformed

    private void buttonChangeOpacityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChangeOpacityActionPerformed
        this.currentImage = null;
        ChangeOpacity newContentPane1 = new PointOperationHandler().viewChangeOpacity(picPath);
        tabPanel.removeAll();
        tabPanel.add("Change Opacity", newContentPane1);
    }//GEN-LAST:event_buttonChangeOpacityActionPerformed

    private void buttonCropImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCropImageActionPerformed
        this.currentImage = null;
        CropImage newContentPane1 = new PointOperationHandler().viewCropImage(picPath);
        tabPanel.removeAll();
        tabPanel.add("Crop Image", newContentPane1);
    }//GEN-LAST:event_buttonCropImageActionPerformed

    private void buttonChangeContrastActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChangeContrastActionPerformed
        this.currentImage = null;
        ChangeContrast newContentPane1 = new PointOperationHandler().viewChangeContrast(picPath);
        tabPanel.removeAll();
        tabPanel.add("Change Contrast", newContentPane1);
    }//GEN-LAST:event_buttonChangeContrastActionPerformed

    private void buttonNormalViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNormalViewActionPerformed
        tabPanel.removeAll();
        Component newContentPane1 = new ScrollImage(new ImageIcon(new PointOperationHandler().getBufferedImage(picPath)));
        tabPanel.add("Normal", newContentPane1);
    }//GEN-LAST:event_buttonNormalViewActionPerformed

    private void menuItemOpenImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItemOpenImageActionPerformed
        //Set up the file chooser.
        if (fc == null) {
            fc = new JFileChooser();

            //Add a custom file filter and disable the default
            //(Accept All) file filter.
            fc.addChoosableFileFilter(new ImageFilter());
            fc.setAcceptAllFileFilterUsed(false);

            //Add custom icons for file types.
            fc.setFileView(new ImageFileView());

            //Add the preview pane.
            fc.setAccessory(new ImagePreview(fc));
        }

        //Show it.
        int returnVal = fc.showDialog(this,
                "Attach");

        //Process the results.
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();

            this.picPath = file.getAbsolutePath();
            textFieldBrowse.setText(this.picPath);
        } else {

            //custom title, warning icon
            JOptionPane.showMessageDialog(this,
                    "You have to select a picture in order to apply operations.",
                    "Warning",
                    JOptionPane.WARNING_MESSAGE);
        }

        //Reset the file chooser for the next time it's shown.
        fc.setSelectedFile(null);
        
    }//GEN-LAST:event_menuItemOpenImageActionPerformed

    private void menuItemSaveImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItemSaveImageActionPerformed
         /*
         * Save the filtered image in the selected format. The selected item
         * will be the name of the format to use
         */
        String format = (String) comboBoxFormat.getSelectedItem();
        /*
         * Use the format name to initialise the file suffix. Format names
         * typically correspond to suffixes
         */
        if (currentImage != null) {
            File saveFile = new File("savedimage." + format);
            JFileChooser chooser = new JFileChooser();
            chooser.setSelectedFile(saveFile);
            int rval = chooser.showSaveDialog(comboBoxFormat);
            if (rval == JFileChooser.APPROVE_OPTION) {
                saveFile = chooser.getSelectedFile();
                /*
                 * Write the filtered image in the selected format, to the file
                 * chosen by the user.
                 */
                chooser.setSelectedFile(null);
                try {
                    this.buffImage = getBufferedImage(currentImage);
                    ImageIO.write(buffImage, format, saveFile);
                } catch (IOException ex) {
                    chooser.setSelectedFile(null);
                }
            }else{
                JOptionPane.showMessageDialog(this,
                    "You have to create a picture in order to apply operations.",
                    "Warning",
                    JOptionPane.WARNING_MESSAGE);
            }
        }
    }//GEN-LAST:event_menuItemSaveImageActionPerformed

    private void menuItemCropActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItemCropActionPerformed
       this.currentImage = null;
        CropImage newContentPane1 = new PointOperationHandler().viewCropImage(picPath);
        tabPanel.removeAll();
        tabPanel.add("Crop Image", newContentPane1);
    }//GEN-LAST:event_menuItemCropActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        JFrame f = new JFrame("See Through Image");
        f.setPreferredSize(new Dimension(650, 250));
        f.setLocationRelativeTo(null);
        f.addWindowListener(new WindowAdapter() {

            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
        JPanel p = new JPanel();
        String newLine = "\n";
        JTextArea l=new JTextArea(newLine+newLine+
 "************************************************************************************"+newLine+
 "* @Author : Gihan Chanuka Karunarathne "+newLine+
 "* @Index Number : 090248X "+newLine+
 "* @Address : 123, R.B.Rathnamalala Road, Eppawala, Anuradhapura, Sri Lanka. 50260"+newLine+
 "* @Bsc : Department of Computer Science and Engineering"+newLine+
 "*        University of Moratuwa, Sri Lanka"+newLine+
 "* Date created : "+newLine+
 "* @Email : gckarunarathne@gmail.com"+newLine+
 "* Twitter: https://twitter.com/#!/gihanchanuka"+newLine+
 "* LinkedIn: http://lk.linkedin.com/pub/gihan-karunarathne/25/ba3/993  "+newLine+
 "************************************************************************************"+newLine
                );
        p.add(l);       
        f.add("Center", p);
            f.setSize(1000, 700);
            f.pack();
            f.setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    public BufferedImage getBufferedImage(ImageIcon imageIcon) {
        Image img = imageIcon.getImage();

        BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = bi.createGraphics();
// Draw img into bi so we can write it to file.
        g2.drawImage(img, 0, 0, null);
        g2.dispose();
        return bi;
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainWindow().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bottonVerticalFlip;
    private javax.swing.JButton buttonBiLinearScaleDown;
    private javax.swing.JButton buttonBiLinearScaleUp;
    private javax.swing.JButton buttonBitSlicingWithBackGround;
    private javax.swing.JButton buttonBitSlicingWithoutBackGround;
    private javax.swing.JButton buttonBrowse;
    private javax.swing.JButton buttonChangeBrightness;
    private javax.swing.JButton buttonChangeContrast;
    private javax.swing.JButton buttonChangeOpacity;
    private javax.swing.JButton buttonCropImage;
    private javax.swing.JButton buttonDigitalNegative;
    private javax.swing.JButton buttonHistogram;
    private javax.swing.JButton buttonLinear3x3;
    private javax.swing.JButton buttonLinearHorizontalDown;
    private javax.swing.JButton buttonLinearHorizontalUp;
    private javax.swing.JButton buttonLinearMxN;
    private javax.swing.JButton buttonLinearVerticalDown;
    private javax.swing.JButton buttonLinearVerticalUp;
    private javax.swing.JButton buttonMean3x3;
    private javax.swing.JButton buttonMean5x5;
    private javax.swing.JButton buttonMedian3x3;
    private javax.swing.JButton buttonMedian5x5;
    private javax.swing.JButton buttonNearestScaleDown;
    private javax.swing.JButton buttonNearestScaleUp;
    private javax.swing.JButton buttonNormalView;
    private javax.swing.JButton buttonSave;
    private javax.swing.JButton buttonTranspose;
    private javax.swing.JComboBox comboBoxFormat;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JMenuItem menuItemCrop;
    private javax.swing.JMenuItem menuItemOpenImage;
    private javax.swing.JMenuItem menuItemSaveImage;
    private javax.swing.JPanel panelBottom;
    private javax.swing.JPanel panelLeft;
    private javax.swing.JPanel panelUpper;
    private javax.swing.JTabbedPane tabPanel;
    private javax.swing.JTextField textFieldBrowse;
    // End of variables declaration//GEN-END:variables
}
